//============================================================================
// Name        : AnchorText.h
// Author      : lucmir@dcc.ufmg.br
// Description :
//============================================================================

#ifndef __ANCHOR_TEXT_H__
#define __ANCHOR_TEXT_H__

#include <stdio.h>
#include <string>
#include <iostream>
#include <map>
#include <list>
#include <fstream>
#include <sstream>
#include <math.h>

#define NOT_FOUND	0

class AnchorText {

	// Hash: term from anchor text -> map<document_id, freq>
	std::map<unsigned int, std::map<unsigned int, unsigned int> *> terms;


	public:

		AnchorText();
		~AnchorText();

		unsigned int containsTerm(unsigned int termId, unsigned int docId);
		void insertTerm(unsigned int termId, unsigned int docId);
		void insertTerm(unsigned int termId, unsigned int docId, unsigned int freq);
		bool readFromFile(std::string inFileName);
		bool printToFile(std::string outFileName);

};

#endif
